﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;


namespace VehicleManagement.Models
{
    //AddGasID int  IDENTITY(1,1) primary key,
    //CarID int,
    //DriverID INT not null ,
    //Gas_Date Datetime,
    //InvoiceNo  nvarchar(18) unique,
    //Gas_Name nvarchar(18),
    //Gas_Type nvarchar(10),
    //Price decimal(18,2),
    //Num decimal(18,2),
    //Cost decimal(18,2),
    //Approval bit,
    //Distance decimal(18,2),
    //GasSta_Name nvarchar(18),
    //Remark  char(100),

        // public int AddGasID { get; set; } 
        //public int CarID { get; set; }
        //public int  DriverID { get; set; }
        //virtual public string Driver_name { get; set; }
        //public DateTime  Gas_Date { get; set; }
        //public string InvoiceNo { get; set; }
        //public string  Gas_Name { get; set; }
        //public string  Gas_Type { get; set; }
        //public decimal Price { get; set; }
        //public decimal  Num { get; set; }
        //public decimal  Cost { get; set; }
        //public bool   Approval { get; set; }
        //public decimal Distance { get; set; }
        //public string  GasSta_Name { get; set; }
        //public string Remark { get; set; }


    public class AddGas
    {
        [DisplayName("加油编码")]
        [Required(ErrorMessage = "加油编码不能为空")]
        public int AddGasID { get; set; }

        [DisplayName("车辆编码")]
        [Required(ErrorMessage = "车辆编码不能为空")]
        public int CarID { get; set; }

        [DisplayName("车牌号")]
        [Required(ErrorMessage = "车牌号不能为空")]
        [StringLength(12, ErrorMessage = "车牌号长度不能超过12位")]
         public string Car_num { get; set; }

        [DisplayName("司机号码")]
        [Required(ErrorMessage = "司机号不能为空")]
        public int  DriverID { get; set; }

        [DisplayName("司机姓名")]
        [Required(ErrorMessage = "司机姓名不能为空")]
        [StringLength(18, ErrorMessage = "司机姓名长度不能超过18位")]
        virtual public string Driver_name { get; set; }

        [DisplayName("加油日期")]
        [Required(ErrorMessage = "加油日期不能为空")]
        public DateTime  Gas_Date { get; set; }

        [DisplayName("发票编号")]
        [Required(ErrorMessage = "发票编号不能为空")]
        [StringLength(18, ErrorMessage = "发票编号长度不能超过18位")]
        public string InvoiceNo { get; set; }

        [DisplayName("加油名称")]
        [Required(ErrorMessage = "加油名称不能为空")]
        [StringLength(18, ErrorMessage = "加油名称长度不能超过18位")]
        public string  Gas_Name { get; set; }

        [DisplayName("加油类型")]
        [Required(ErrorMessage = "加油类型不能为空")]
        [StringLength(18, ErrorMessage = "加油类型长度不能超过18位")]
        public string  Gas_Type { get; set; }

       
        public decimal Price { get; set; }

       
        public decimal  Num { get; set; }

        [DisplayName("加油总价")]
        [Required(ErrorMessage = "加油类型不能为空")]
        public decimal  Cost { get; set; }

        [DisplayName("是否批准")]
        [Required(ErrorMessage = "加油类型不能为空")]
        public bool   Approval { get; set; }

        [DisplayName("行驶距离")]
        [Required(ErrorMessage = "行驶距离不能为空")]
        public decimal Distance { get; set; }

        [DisplayName("加油站名称")]
        [Required(ErrorMessage = "加油站名称不能为空")]
        [StringLength(18, ErrorMessage = "司机姓名长度不能超过18位")]
        public string  GasSta_Name { get; set; }

        [DisplayName("备注")]
        [Required(ErrorMessage = "备注不能为空")]
        [StringLength(100, ErrorMessage = "备注长度不能超过100位")]
        public string Remark { get; set; }
    }
}